package com.heima.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.github.pagehelper.Page;
import com.heima.pojo.VendingMachine;
import com.heima.pojo.dto.VMDto;
import com.heima.pojo.vo.NodeInfoVo;
import com.heima.pojo.vo.NodeVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface VMMapper extends BaseMapper<VendingMachine> {
    Page<NodeInfoVo> findByInnerCode(VMDto vmDto);

    @Select("SELECT MAX(inner_code) FROM tb_vending_machine WHERE city_code = #{cityCode}")
    String findMaxInnerCode(String cityCode);

    int updateNode(Integer id, String nodeId);
}
